{php $arr_ignore = array(12,13,14,15)}
{if !in_array($catid,$arr_ignore)}
<div class="sidebar">
    <dl>
        <dt>
            {if $top_parentid == 6}
                <a href="{$CATEGORYS[6][url]}"><img src="images/sidemenu_book.jpg" alt=""/></a>
            {elseif $top_parentid == 7}
                <a href="{$CATEGORYS[7][url]}"><img src="images/sidemenu_picture.jpg" alt=""/></a>
            {elseif $top_parentid == 8}
                <a href="{$CATEGORYS[8][url]}"><img src="images/sidemenu_science.jpg" alt=""/></a>
            {elseif $top_parentid == 9}
                <a href="{$CATEGORYS[9][url]}"><img src="images/sidemenu_product.jpg" alt=""/></a>
            {elseif $parentid == 1}
                <a href="{$CATEGORYS[2][url]}"><img src="images/sidemenu_service.jpg" alt=""/></a>
            {/if}
        </dt>
        {if $parentid != 1}
            {php $parentid = $top_parentid}
        {/if}

        {pc:content action="category" catid="$parentid" num="10" siteid="$siteid" order="listorder ASC"}
        {loop $data $r}
        <dd><div class="item"><a class="icon" href="javascript:void(0);"></a><a class="itm {if $r[catid]==$catid} cur{/if}" href="{$r[url]}">{$r[catname]}</a></div>
            {if $r['child']}
            {php $arrchild = $r[arrchildid]}
            {php $pos = strpos($arrchild,',')+1}
            {php $arrchild = substr($arrchild, $pos)}
            {pc:get sql="SELECT * FROM `v9_category` WHERE catid in ($arrchild) ORDER BY listorder DESC" cache="3600"  return="data"}
            <ul class="child-item">
                {loop $data $v}
                <li><a href="{$v[url]}" {if $v[catid]==$catid}class="cur"{/if}>.{$v[catname]}</a></li>
                {/loop}
            </ul>
            {/pc}
            {/if}
        </dd>
        {/loop}
        {/pc}
    </dl>
</div>
<script type="text/javascript" src="js/common.js"></script>
{/if}